home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-06-05 | 3.1 KB | 93 lines | [MATS/MATL] |
- NUMERICAL METHODS:
- MATLAB Programs
- (c) 1994 by John H. Mathews
-
- To Accompany
-
- NUMERICAL METHODS
- for Mathematics, Science,
- and Engineering
- Second Edition
- PRENTICE HALL, INC.
- Englewood Cliffs, NJ 07632
- (c) 1992, 1987 by
- John H. Mathews
- California State University, Fullerton
- E-mail mathews@fullerton.edu
-
-
-
- This free software is complements of the author.
- It is permissible to copy this software for educational purposes, provided
- that it is used with the textbook. The software may not be sold for profit and
- may only be sold in such a way that the cost of reproduction are recovered.
-
-
-
- PREFACE
-
- This disk contains numerical methods software coded in
- MATLAB. The algorithms are described in the text NUMERICAL
- METHODS for Mathematics, Science, and Engineering.
- A printed version of this material is titled
- "MATLAB Programming Guidebook for NUMERICAL METHODS."
- The author appreciates correspondence regarding both the
- textbook and the supplements. You are welcome to correspond
- by mail or electronic mail.
-
- Prof. John H. Mathews
- Department of Mathematics
- California State University Fullerton
- Fullerton, CA 92634
- (714) 773-3631
- (714) 773-3196
- mathews@fullerton.edu
-
-
- INSTRUCTIONS
-
- 1. For the PC version:
- Move to the appropriate directory: chap_2, chap_3, ... etc.
-
- For the Macintosh version:
- Move to the appropriate folder: chap_2, chap_3, ... etc.
-
- 2. All of the algorithms for the text have been coded in
- Matlab's programming language and stored as subroutines.
- The example files for chap_2 are named a2_1.m, a2_2.m, ... etc.
-
- 3. The textbook discusses the following algorithm:
-
- Algorithm 2.1 (Fixed Point Iteration). To find a solution to the equation
- x = g(x) by starting with p(0) and iterating p(n+1) = g(p(n)).
-
- To run the example for Algorithm 2.1 the user needs to use the script file
- named a2_1.m. This is accomplished by executing the Matlab command:
-
- a2_1
-
- 3. The Matlab script in a2_1.m will call the subroutine named fixpt.m
- which is included in the sub directory or folder named chap_2.
- Also, for the above example, the following function must exist as a
- M-file named g.m.
-
- function y = g(x)
- y = 1 + x - x.^2 ./4;
-
- For demonstration purposes, I have used a special Matlab feature which
- opens and writes to a file to ensure that the above M-file g.m will exist
- in the proper sub directory or folder along with the script file a2_1.m and
- function (subroutine) file fixpt.m. These commands are:
-
- delete g.m
- diary g.m; disp('function y = g(x)');...
- disp('y = 1 + x - x.^2 ./4;');...
- diary off;
-
- 4. Once the process of writing a function M-files has been mastered,
- it is not necessary to use the diary commands mentioned above
- to create this function M-file named g.m. The user can then
- delete these lines from the script file a2_1.m.
-
-
-